import VueRouter from 'vue-router'

//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Forum from '../pages/forum/list'
import ForumAdd from '../pages/forum/add'
import ForumDetail from '../pages/forum/detail'
import MyForumList from '../pages/forum/myForumList'
import Storeup from '../pages/storeup/list'
import News from '../pages/news/news-list'
import NewsDetail from '../pages/news/news-detail'
import luntanguanliyuanList from '../pages/luntanguanliyuan/list'
import luntanguanliyuanDetail from '../pages/luntanguanliyuan/detail'
import luntanguanliyuanAdd from '../pages/luntanguanliyuan/add'

import yonghuList from '../pages/yonghu/list'
import yonghuDetail from '../pages/yonghu/detail'
import yonghuAdd from '../pages/yonghu/add'
import qiuduixinxiList from '../pages/qiuduixinxi/list'
import qiuduixinxiDetail from '../pages/qiuduixinxi/detail'
import qiuduixinxiAdd from '../pages/qiuduixinxi/add'
import bisaisaichengList from '../pages/bisaisaicheng/list'
import bisaisaichengDetail from '../pages/bisaisaicheng/detail'
import bisaisaichengAdd from '../pages/bisaisaicheng/add'
import jingcaishipinList from '../pages/jingcaishipin/list'
import jingcaishipinDetail from '../pages/jingcaishipin/detail'
import jingcaishipinAdd from '../pages/jingcaishipin/add'
import bisaijieguoList from '../pages/bisaijieguo/list'
import bisaijieguoDetail from '../pages/bisaijieguo/detail'
import bisaijieguoAdd from '../pages/bisaijieguo/add'


const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
    routes: [
        {
            path: '/',
            redirect: '/index/home'
        },
        {
            path: '/index',
            component: Index,
            children: [
                {
                    path: 'home',
                    component: Home
                },
                {
                    path: 'center',
                    component: Center,
                },
                {
                    path: 'forum',
                    component: Forum
                },
                {
                    path: 'forumAdd',
                    component: ForumAdd
                },
                {
                    path: 'forumDetail',
                    component: ForumDetail
                },
                {
                    path: 'myForumList',
                    component: MyForumList
                },
                {
                    path: 'storeup',
                    component: Storeup
                },
                {
                    path: 'news',
                    component: News
                },
                {
                    path: 'newsDetail',
                    component: NewsDetail
                },
                {
                    path: 'luntanguanliyuan',
                    component: luntanguanliyuanList
                },
                {
                    path: 'luntanguanliyuanDetail',
                    component: luntanguanliyuanDetail
                },
                {
                    path: 'luntanguanliyuanAdd',
                    component: luntanguanliyuanAdd
                },
                {
                    path: 'Zhiboguanliyuan',
                    component: ZhiboguanliyuanList
                },
                {
                    path: 'ZhiboguanliyuanDetail',
                    component: ZhiboguanliyuanDetail
                },
                {
                    path: 'ZhiboguanliyuanAdd',
                    component: ZhiboguanliyuanAdd
                },
                {
                    path: 'yonghu',
                    component: yonghuList
                },
                {
                    path: 'yonghuDetail',
                    component: yonghuDetail
                },
                {
                    path: 'yonghuAdd',
                    component: yonghuAdd
                },
                {
                    path: 'qiuduixinxi',
                    component: qiuduixinxiList
                },
                {
                    path: 'qiuduixinxiDetail',
                    component: qiuduixinxiDetail
                },
                {
                    path: 'qiuduixinxiAdd',
                    component: qiuduixinxiAdd
                },
                {
                    path: 'bisaisaicheng',
                    component: bisaisaichengList
                },
                {
                    path: 'bisaisaichengDetail',
                    component: bisaisaichengDetail
                },
                {
                    path: 'bisaisaichengAdd',
                    component: bisaisaichengAdd
                },
                {
                    path: 'jingcaishipin',
                    component: jingcaishipinList
                },
                {
                    path: 'jingcaishipinDetail',
                    component: jingcaishipinDetail
                },
                {
                    path: 'jingcaishipinAdd',
                    component: jingcaishipinAdd
                },
                {
                    path: 'bisaijieguo',
                    component: bisaijieguoList
                },
                {
                    path: 'bisaijieguoDetail',
                    component: bisaijieguoDetail
                },
                {
                    path: 'bisaijieguoAdd',
                    component: bisaijieguoAdd
                },
                {
                    path: 'Saishizhibo',
                    component: SaishizhiboList
                },
                {
                    path: 'SaishizhiboDetail',
                    component: SaishizhiboDetail
                },
                {
                    path: 'SaishizhiboAdd',
                    component: SaishizhiboAdd
                },
            ]
        },
        {
            path: '/login',
            component: Login
        },
        {
            path: '/register',
            component: Register
        },
    ]
})
